package com.wjp.banquet.common.util;

import org.springframework.lang.Nullable;

import java.util.Collection;
import java.util.Map;

/**
 * @Author 王君平
 * @Date 2023/11/26 17:38
 * @Description
 */
public class CollectionUtil {

    public static boolean isNotEmpty(@Nullable Collection<?> collection) {
        return collection != null && !collection.isEmpty();
    }

    public static boolean isEmpty(@Nullable Collection<?> collection) {
        return collection == null || collection.isEmpty();
    }

    public static boolean isEmpty(@Nullable Map<?, ?> map) {
        return map == null || map.isEmpty();
    }

    public static boolean isNotEmpty(@Nullable Map<?, ?> map) {
        return map != null && !map.isEmpty();
    }
}
